package cn.edu.xmu.restfuldemo.model.BO;

import cn.edu.xmu.restfuldemo.model.PO.OrderItemPo;
import lombok.*;

import java.time.LocalDateTime;

/**
 * @author Team3-5
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class OrderItem {
    private Long id;
    private Long orderId;
    private Long goodsSkuId;
    private Integer quantity;
    private Long price;
    private Long discount;
    private String name;
    private Long couponActivityId;
    private Long beShareId;
    private LocalDateTime gmtCreate;
    private LocalDateTime gmtModified;

    /**
     * orderItem->orderItemPo
     * @return orderItemPo
     */
    public OrderItemPo newOrderItemPo(){
        OrderItemPo orderItemPo = new OrderItemPo();
        orderItemPo.setId(this.id);
        orderItemPo.setOrderId(this.orderId);
        orderItemPo.setGoodsSkuId(this.goodsSkuId);
        orderItemPo.setQuantity(this.quantity);
        orderItemPo.setPrice(this.price);
        orderItemPo.setDiscount(this.discount);
        orderItemPo.setName(this.name);
        orderItemPo.setCouponActivityId(this.couponActivityId);
        orderItemPo.setBeShareId(this.beShareId);
        orderItemPo.setGmtCreate(this.gmtCreate);
        orderItemPo.setGmtModified(this.gmtModified);
        return orderItemPo;
    }
}
